package com.wc.AlgoOJ_train.train3_算法大礼包.c3_贪心.AG0404_熊舍的魔法阵;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/1/28 23:35
 * @description http://43.138.190.70:8888/p/AG0404
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int r, n;
    static int N = 200010;
    static int[] a = new int[N];

    public static void main(String[] args) {
        while (sc.hasNext()) {
            r = sc.nextInt();
            n = sc.nextInt();
            if (r == -1 && n == -1) {
                break;
            }
            for (int i = 1; i <= n; i++) {
                a[i] = sc.nextInt();
            }
            Arrays.sort(a, 1, n + 1);
            int ans = 1;
            int pre = 1;
            for (int i = 1; i <= n; i++) {
                // 首先看谁和最前面的大于r了
                if (a[i] - a[pre] > r) {
                    // 设置中心点为前一个，前面的已经覆盖了
                    pre = i - 1;
                    // 查看后面的是否满足，满足就加进来
                    while (a[i] - a[pre] <= r && i <= n) {
                        i++;
                    }
                    // 是否满足的到达了最后一个
                    if (i == n + 1) {
                        // 说明这一个罩子已经完全笼罩了，抵消最后一个
                        ans--;
                    }
                    // 把中心点设置为这个
                    pre = i;
                    // 下一个罩子
                    ans++;
                }
            }
            // 最后一个面罩
            out.println(ans);
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}